<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Bank_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!--            <input id="c-bank_id" data-rule="required" data-source="bank/index" class="form-control selectpage" name="row[bank_id]" type="text" value="">-->
            <input id="c-bank_id" data-rule="required"
                   data-source="question_bank/index" data-field="name"
                   data-multiple="false" class="form-control selectpage"
                   data-primary-key="id"
                   disabled
                   name="row[bank_id]" type="text" value="{$row.bank_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.type" }selected{
                /in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Q_info')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-q_info" class="form-control" name="row[q_info]" type="text">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Q_item')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[question_items]" data-template="testtpl">
                <dd>
                    <ins>选项</ins>
                    <ins>描述</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                </dd>
                <textarea name="row[question_items]" class="form-control hide" cols="30" rows="4">
                [{"q_a":"A","q_detail":""},
                {"q_a":"B","q_detail":""},
                {"q_a":"C","q_detail":""},
                {"q_a":"D","q_detail":""}
                ]
            </textarea>
            </dl>
            <!--定义模板-->
            <script type="text/html" id="testtpl">
                <dd class="form-inline">
                    <input type="text" name="row[<%=name%>][<%=index%>][q_a]" class="form-control"
                           value="<%=row['q_a']%>" size="10">
                    <input type="text" name="row[<%=name%>][<%=index%>][q_detail]" class="form-control"
                           value="<%=row['q_detail']%>" size="30">
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>

    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Difficulty')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-difficulty" class="form-control selectpicker" name="row[difficulty]">
                {foreach name="difficultyList" item="vo"}
                <option value="{$key}" {in name="key" value="" }selected{
                /in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-score" class="form-control" name="row[score]" type="number" value="5">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-answer" class="form-control" name="row[answer]">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Comm')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-comm" class="form-control " rows="5" name="row[comm]" cols="50"></textarea>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('QStatus')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="qStatusList" item="vo"}
                <label for="row[q_status]-{$key}"><input id="row[q_status]-{$key}" name="row[q_status]" type="radio" value="{$key}" {in name="key" value=""}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>



    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
